package com.ssm.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.ssm.dao.PositionMapper;
import com.ssm.pojo.Position;
import com.ssm.service.PositionService;

@Service("PositionService")
public class PositionServiceImpl implements PositionService{
	@Resource
	private PositionMapper positionDao;
	

	@Override
	public List<Position> getPositionPager(int pageNO, int size) {
		int skip=(pageNO-1)*size;
		return positionDao.getAllPosition(skip, size);
	}


	@Override
	public int getPositionCount() {
		// TODO Auto-generated method stub
		return positionDao.getPositionCount();
	}


	@Override
	public int insterPosition(Position p) {
		
		return positionDao.insert(p);
	}


	@Override
	public List<Position> getmyPositionPager(int pageNO, int size, int cId) {
		// TODO Auto-generated method stub
		int skip=(pageNO-1)*size;
		return positionDao.getmyPosition(skip, size, cId);
	}


	@Override
	public int getmyPositionCount(int cId) {
		// TODO Auto-generated method stub
		return positionDao.getmyPositionCount(cId);
	}


	@Override
	public int delposition(int zId) {
		// TODO Auto-generated method stub
		return positionDao.deleteByPrimaryKey(zId);
	}

	


}
